using System.Data.Entity.ModelConfiguration;
using System.ComponentModel.DataAnnotations;

namespace DemoApp.DataAccess 
{
  public partial class UserEntityConfiguration 
    : EntityTypeConfiguration<User>
  {
    public UserEntityConfiguration()
    {
      HasEntitySetName(@"Users");
      Map(map => {
        map.ToTable(@"Users");
      });
      HasKey(e => new { e.UserId });
 

      Property(e => e.UserId) 
        .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

      Property(e => e.UserName) 
        .HasMaxLength(20);

      Property(e => e.Password) 
        .HasMaxLength(20);
 
    }
  }
}
